
<template>
	<el-dialog title="物品详情" visible :show-close="false" :modal-append-to-body="false" class="wrap" size="tiny">
		<i class="el-icon-close close" @click="cancel"></i>
		<el-form label-width="120px" class="form">
			<el-form-item label="课程名称">
				  <el-input v-model="form.kcmc" :readonly='true' icon="info" class="select-block"></el-input>
			</el-form-item>
			<!--<el-form-item label="学校名称">
				  <el-input v-model="form.xxmc" :readonly='true' icon="info" class="select-block"></el-input>
			</el-form-item>-->
			<el-form-item label="创建时间">
				  <el-input v-model="form.dt" :readonly='true' icon="info" class="select-block"></el-input>
			</el-form-item>
			<el-form-item label="价格">
				  <el-input v-model="form.jg" :readonly='true' icon="info" class="select-block"></el-input>
			</el-form-item>
			<el-form-item label="基础价格">
				  <el-input v-model="form.jcjg" :readonly='true' icon="info" class="select-block"></el-input>
			</el-form-item>
			<el-form-item label="课时">
				  <el-input v-model="form.ks" :readonly='true' icon="info" class="select-block"></el-input>
			</el-form-item>
			<el-form-item label="是否启用 ">
				<el-input v-model="form.sfjs" :readonly='true' icon="info" class="select-block"></el-input>
                <!-- <el-select v-model="form.sfjs">
                    <el-option label="启用" value="Y"></el-option>
                    <el-option label="禁用" value="N"></el-option>
                </el-select> -->
 			</el-form-item>
			<el-form-item label="启用/失效时间">
				  <el-input v-model="form.xfsj" :readonly='true' icon="info" class="select-block"></el-input>
			</el-form-item>
		</el-form>
		<el-button type="info" class="submit" @click="cancel">确定</el-button>
	</el-dialog>
</template>

<script type="text/javascript">
	import qs from 'qs'
	export default {
		props: ['params'],
		data() {
			return {
				form: {
					kcmc :'',
					xxmc :'',
					dt :'',
					jg :'',
					jcjg :'',
					ks :'',
					sfjs :'Y',
					xfsj :'',
					id: ''
				},
			}
		},
		created() {
           this.form.id=this.params.row.id;
			this.loadinfo();
		},
		methods: {
			loadinfo(){
				 var logininfo = JSON.parse(localStorage.logininfo) ;
				 var params3 = qs.stringify({
					 xxid:logininfo.xxid,
					 yhid:logininfo.id,
					 id:this.form.id
				});
				 this.axios.post(this.$store.state.api+'fxkc/info',params3)
				 .then( res =>  {
							this.form=res.data.data
					 }).catch(res => {
						 this.$message.warning("服务器异常");
			 				this.$emit('close', { type: 'info', cancel: true });
					 })
			},
			cancel() {
				this.$emit('close', { type: 'info', cancel: true })
			}
		}
	}
</script>

<style lang="less" scoped>
	.wrap {
		text-align: center;
	}
	.form {
		text-align: left;
	}
	 .input {
            width: 300px;
            display: inline-block;
        }

	.select-block {
		display: block;
	}

	.submit {
		width: 120px;
	}
</style>
